<template>
  <view>
    <!--#ifdef APP-PLUS-->
    <view class="lz-status_bar">
      <view class="lz-top_view"></view>
    </view>
    <!--#endif-->
    <view class="kaoshi-head">
      <view class="kaoshi-head-top">
        <view class="kaoshi-head-left">
          <view class="iconfont icon-zuojiantou" @tap="$navigateBack"></view>
        </view>
        <view class="kaoshi-head-m">考试报告</view>
      </view>
    </view>
    <view class="kaoshi-question-over">
      <view class="kaoshi-question-over-title">
        <view>交卷时间：{{up_time}}</view>
      </view>
      <view class="kaoshi-baogao">
        <view class="kaoshi-baogao-title"><view class="kaoshi-baogao-title-l">{{pages_params.score}}</view>分</view>
      </view>
      <view class="kaoshi-question-over-content">
        <view class="kaoshi-question-over-content-flex">
          <view>考试用时</view>
          <view class="kaoshi-question-over-content-time">{{use_time}}</view>
        </view>
        <view class="kaoshi-question-over-content-flex">
          <view>答对</view>
          <view class="kaoshi-question-over-content-num"><span>{{pages_params.dadui_num}}</span>
            <view>/{{pages_params.total_num}}</view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
  export default {
    data(){
      return {
        pages_params: {},
        jiaojuaninfo: {}
      }
    },
    computed:{
      up_time() {
				let start = this.pages_params.up_time || 0
				let sec = start;
				let date = new Date(start * 1000)
				let hour = date.getHours();
				let miu = date.getMinutes();
				let s = date.getSeconds();
				// formatDigit
				hour = this.$myUtils.$common.formatDigit(hour)
				miu = this.$myUtils.$common.formatDigit(miu)
				s = this.$myUtils.$common.formatDigit(s)
				return `${hour}:${miu}:${s}`
      },
			use_time () {
				//usetime
				let start = this.pages_params.usetime || 0
				let hour = parseInt(start / 3600);
				let miu = parseInt((start - hour * 3600) / 60);
				let s = start - hour * 3600 - miu * 60;
				// formatDigit
				hour = this.$myUtils.$common.formatDigit(hour)
				miu = this.$myUtils.$common.formatDigit(miu)
				s = this.$myUtils.$common.formatDigit(s)
				return `${hour}:${miu}:${s}`
			}
    },
    components: {},
    onLoad(opts) {
      this.pages_params = this.$myCatch.getItem("jiaojuan_info")
    },
    methods:{
      tap_handler (type) {
          uni.navigateBack({
              delta: 1
          });
      }
    }
  };
</script>

<style>
page {
  background: #fff;
}
/*练习报告*/
.kaoshi-question-over {
  background: #fff;
}
.kaoshi-question-over-title {
  width: 90%;
  margin: 0 auto;
  font-size: 16px;
  color: #898f94;
  margin-top: 16px;
  text-align: center;
}
.kaoshi-question-over-content {
  display: flex;
  width: 81%;
  margin: 0 auto;
  justify-content: space-between;
  font-size: 16px;
  color: #9a9a9a;
}
.kaoshi-question-over-content .kaoshi-question-over-content-flex:first-child {
  border-right: solid 1px #f5f5f5;
  flex: 1;
  text-align: center;
}
.kaoshi-question-over-content .kaoshi-question-over-content-flex:last-child {
  line-height: 20px;
  text-align: center;
}
.kaoshi-question-over-content-flex {
  flex: 1;
}
.kaoshi-question-over-content-time {
  color: #000;
  font-size: 20px;
  padding-top: 4px;
}
.kaoshi-question-over-content-num {
  font-size: 16px;
  padding-top: 4px;
  display: flex;
  align-items: baseline;
  justify-content: center;
}
.kaoshi-question-over-content-flex span {
  color: #000;
  font-size: 20px;
}
.kaoshi-baogao{
  background: url() no-repeat;
  background-size: contain;
	width: 180px !important;
	height: 180px;
	margin: 33px auto;
	text-align: center;
	color: #000;
	display: flex;
	align-items: center;
	flex-direction: column;
}
.kaoshi-baogao-title{
  padding-top: 32%;
  display: flex;
  align-items: baseline;
}
.kaoshi-baogao-title-l{
  font-size: 32px;
}
</style>
